#include<stdio.h>

// 函数声明
int sum(int a, int b);

// 函数声明和实现
int sum2(int a, int b)
{
    return a + b;
}

#define sum4(a, b) sum(a, b)

#define sum5(a, b) (a + b)

// static 函数的作用域仅限于定义它的源文件
static int sum_static(int a, int b)
{
    return a + b;
}


int main(int argc, char const *argv[])
{
    /* code */
    printf("sum,%d\n", sum(1, 2));
    printf("sum2,%d\n", sum2(1, 2));
    printf("sum3,%d\n", sum3(3, 7));
    printf("sum4,%d\n", sum4(3, 7));
    printf("sum5,%d\n", sum5("1", 7));
    printf("sum_static,%d\n", sum_static(3, 7));
    return 0;
}

// 函数实现
int sum(int a, int b)
{
    return a + b;
}

// 未申明函数会警告warning: implicit declaration of function 'sum3';
int sum3(int a, int b)
{
    return a + b;
}
